//
//  MineCell.m
//  copyrightTrading
//
//  Created by 郭子一 on 2020/10/6.
//  Copyright © 2020 郭子一. All rights reserved.
//

#import "MineCell.h"
@interface MineCell ()

@property (nonatomic, strong) UIImageView *rightArrowImg;

@end
@implementation MineCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    __weak typeof(self) weakSelf = self;
    self.leftImg = [[UIImageView alloc] init];
    [self addSubview:self.leftImg];
    [self.leftImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(weakSelf.mas_centerY);
        make.left.offset(22);
        make.width.height.mas_equalTo(20);
    }];
    
    self.titleLab = [UILabel new];
    self.titleLab.font = JSS_SourceHanSerifSC_FONT(14);
    [self addSubview:self.titleLab];
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.leftImg.mas_right).offset(15);
        make.width.mas_equalTo(100);
        make.centerY.mas_equalTo(weakSelf.leftImg);
        make.height.mas_equalTo(19);
    }];
    
    self.rightArrowImg = [[UIImageView alloc] init];
    self.rightArrowImg.image = [UIImage imageNamed:@"右"];
    [self addSubview:self.rightArrowImg];
    [self.rightArrowImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(weakSelf.mas_centerY);
        make.right.offset(-28);
        make.width.mas_equalTo(7);
        make.height.mas_equalTo(12);
    }];
    
    self.subLab = [UILabel new];
    self.subLab.backgroundColor = RGB_VALUE(0xFF9417);
    self.subLab.font = JSS_MEDIUM_FONT(14);
    self.subLab.text = @"99";
    self.subLab.textAlignment = NSTextAlignmentCenter;
    self.subLab.layer.masksToBounds = YES;
    self.subLab.layer.cornerRadius = 10;
    self.subLab.textColor = RGB_VALUE(0xFFFFFF);
    [self addSubview:self.subLab];
    [self.subLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-44);
        make.width.mas_equalTo(20);
        make.centerY.mas_equalTo(weakSelf.mas_centerY);
        make.height.mas_equalTo(20);
    }];
    
    UIView *lineView = [UIView new];
    lineView.backgroundColor = RGB_VALUE(0xF5F5F5);
    [self.contentView addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(0);
        make.right.offset(0);
        make.height.mas_equalTo(1);
        make.bottom.offset(0);
    }];
}

@end
